﻿CREATE TABLE [dbo].[Folder] (
    [FolderID]                  UNIQUEIDENTIFIER NOT NULL,
    [ParentFolderID]            UNIQUEIDENTIFIER NULL,
    [WebID]                     UNIQUEIDENTIFIER NULL,
    [ContainingDocumentLibrary] UNIQUEIDENTIFIER NULL,
    [ItemCount]                 INT              NULL,
    [Name]                      VARCHAR (300)    NULL,
    [Url]                       VARCHAR (400)    NULL,
    CONSTRAINT [PK_Folder] PRIMARY KEY CLUSTERED ([FolderID] ASC),
    CONSTRAINT [FK_Folder_Folder1] FOREIGN KEY ([ParentFolderID]) REFERENCES [dbo].[Folder] ([FolderID]),
    CONSTRAINT [FK_Folder_Web] FOREIGN KEY ([WebID]) REFERENCES [dbo].[Web] ([WebID])
);

